extends "../aheye-1/aheye-1.gd"


func _extInit():
	._extInit()
	lv = 2             #等级的设置
	addSkill("开局闪现至同行最后一格，强制最近的敌方单位和自己决斗，并为周围(九宫格范围)的敌人附加4层<剧毒>", "胜利之剑")

func slzj():
	yield(reTimer(0.45), "timeout")
	var mv = Vector2(cell.x ,cell.y)
	if team == 1:mv.x = 8
	else:mv.x = 0
	var vs = [Vector2(0,0),Vector2(1,0),Vector2(-1,0),Vector2(0,1),Vector2(0,-1),Vector2(1,1),Vector2(-1,1),Vector2(-1,-1),Vector2(1,-1),
	Vector2(0,2),Vector2(0,-2),Vector2(0,3),Vector2(0,-3)]
	for i in vs:
		var v = mv+i
		if matCha(v) == null and sys.main.isMatin(v):
			if setCell(v) :
				var pos = sys.main.map.map_to_world(cell)
				ying(pos)
				position = pos
				aiCha = null

				var chas = getAllChas(1)
				chas.sort_custom(self, "sortByDistance")
				var cha = chas[0]
				if cha != null:
					cha.aiCha = self
					aiCha = cha
				for j in getAroundChas(cell, false):
					buff.addJuDu(j, self, 5)
				break

func _onBattleStart():
	._onBattleStart()
	slzj()